<?php include_once './application/views/sys_admin/common/header.php';  ?>
<div class=" definewidth m20">
		<form action="/sys_admin/log/zhs_load_log_info/" method="get" class="form-inline definewidth m20">
  			用户名：<input type="text" id="adminname" name="adminname" style="width: 100px;" value="<?php echo $adminname?>" />
  			时间：<input type="text" id="add_time" name="add_time" style="width: 100px;" value="<?php echo $add_time;?>"  onfocus="WdatePicker()" class="Wdate"/>
  			<button type="button" class="btn btn-primary"  onclick="this.form.submit();" >查询</button>
	  	</form>
		<table class="table table-bordered table-hover definewidth m10">
			 <thead>
			    <tr>
			       <th><strong>id</strong></th>
					<th><strong>用户名</strong></th>
					<th><strong>信息</strong></th>
					<th><strong>登录IP</strong></th>
					<th><strong>时间</strong></th>
					<th><strong>操作</strong></th>
			    </tr>
			   </thead>
			<?php foreach($log_list as $key=>$log){?>
			  <tr id="row_<?php echo $log['id'];?>">
				<td><?php echo $log['id'];?></td>
				<td><?php echo $log['adminname'];?></td>
				<td><?php echo $log['info'];?></td>
				<td><?php echo $log['ip'];?></td>
				<td><?php echo date('Y-m-d H:i',$log['add_time']);?></td>
				<td><a href="javascript:;" onclick="remove(<?php echo $log['id'];?>)">删除</a></td>
			  </tr>
			  <?php }?>
			  	<tr>
			  	<td colspan="12"  class="invbd_page"><?php echo $this->pagination->create_links();?></td>
			  	</tr>
		</table>
</div>
<script>
function remove(id){
	$.ajax({
		type: "post",
		url: "/sys_admin/log/delete_log/",
		data: "id="+id,
		success: function(msg){
			$("#dialog" ).dialog();
			if(msg == 1){
				$("#msg").html("删除成功！");
				$("#row_"+id).hide();
			}else{
				$("#msg").html("删除失败，请联系管理员！");
			}
			setTimeout(function(){
				$("#dialog" ).dialog("close");
			},3000);
		},
		dataType: "text"
	});
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>